//
//  ViewController.m
//  CustomKeyboard
//
//  Created by Tong on 2017/7/4.
//  Copyright © 2017年 Feng. All rights reserved.
//

#import "ViewController.h"

#import "XTEmojiToolbarView.h"
#import "XTEmojiManager.h"
#import "XTEmojiInputView.h"

@interface ViewController ()

@property (nonatomic, weak) XTEmojiToolbarView *toolbarView;

@property (nonatomic, weak) XTEmojiInputView *inputView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    XTEmojiInputView *inputView = [[XTEmojiInputView alloc] initWithFrame:CGRectMake(0, self.view.frame.size.height - 258, self.view.frame.size.width, 258)];
    [self.view addSubview:inputView];
    self.inputView = inputView;
    
    self.inputView.emojiInputResultBlock = ^(XTEmojiInfoModel *infoModel, BOOL isDeleteEmoji) {
        
        if (isDeleteEmoji) {
            
            NSLog(@"\n\n删除表情\n\n");
        }
        NSLog(@"\n\n%@\n\n",infoModel.emojiName);
        
    };
    
    
    self.inputView.emojiToolBarSendBlock = ^{
        NSLog(@"\n\n点击发送\n\n");
    };
}


- (void)viewWillLayoutSubviews
{
    [super viewWillLayoutSubviews];
    
    self.inputView.frame = CGRectMake(0, self.view.frame.size.height - 258, self.view.frame.size.width, 258);
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
